package prototipo.server.logic.person;

import prototipo.server.logic.exception.ExceptionLogic;
import prototipo.server.logic.util.Address;
import prototipo.server.logic.util.Cnpj;
import prototipo.server.logic.util.Cpf;
import prototipo.server.logic.util.Email;
import prototipo.server.logic.util.Phone;

public class Client extends Person implements ClientIF {

	private short route;

	public Client(String name, Address address, Phone phone, Cnpj cnpj,
			Cpf cpf, Email email, short route, String observation) throws ExceptionLogic {
		super(name, address, phone, cnpj, cpf, email, observation);
		this.setRoute(route);
	}

	@Override
	public void generateHistoric(short atLast) {
		// TODO Auto-generated method stub

	}

	/**
	 * @return the route
	 */
	public short getRoute() {
		return route;
	}

	/**
	 * @param route
	 *            the track to set
	 * @throws ExceptionLogic 
	 */
	public void setRoute(short route) throws ExceptionLogic {
		if(route <0) 
			throw new ExceptionLogic("Rota com valor negativo.", new Throwable("Route value is nagative."));
		this.route = route;
	}

}
